pull-pair
A pair of {source, sink} streams that are internally connected,
(what goes into the sink comes out the source)
This can be used to construct pipelines that are connected.
var pull = require('pull-stream')
var pair = require('pull-pair')
var p = pair()
pull(pull.values([1, 2, 3]), p.sink)
pull(p.source, pull.collect(function (err, values) {
if(err) throw err
console.log(values)
}))
This is particularily useful for creating duplex streams especilaly
around servers. Use pull-pair/duplex
to get two duplex streams
that are attached to each other.
var DuplexPair = require('pull-pair/duplex')
var d = DuplexPair()
pull(
pull.values([1,2,3]),
d[0],
pull.collect(console.log)
)
pull(
d[1],
pull.map(function (e) {
return e*10
}),
d[1]
)
License
MIT